import { useState, useEffect } from 'react'
import { reqLogin } from './api/login'
import { setToken } from './utils/auth'
import Router from './router'
import { Provider } from 'react-redux'
import store from './store'
import './App.css'

function App() {

  useEffect(() => {
    console.log('asdfasdfsa');
    reqLogin({ username:"admin", password: "123456"})
      .then(data => {
        console.log(data, 'ddddddddddd')
        const { token } = data.data
        setToken(token)
      })
  }, [])
  
  return (
    <Provider store={store}>
      <div className="App">
        <Router></Router>
      </div>
    </Provider>
  
  )
}

export default App
